package com.sgb.goods.view.adapter;

import android.content.Context;

import androidx.databinding.ViewDataBinding;

import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.goods.BR;
import com.sgb.goods.R;
import com.sgb.goods.entity.ShopMyPriceListEntity;
import com.sgb.goods.utils.base.adapter.BaseCommonAdapter;

/**
 * 商品材料-我的报价
 * @author cyj
 */
public class ShopMyPriceAdapter extends BaseCommonAdapter<ShopMyPriceListEntity> {

    public ShopMyPriceAdapter() {
        super(R.layout.goods_item_shop_my_price, BR.viewModel);
    }

    @Override
    protected void convert(BaseViewHolder baseHolder, ViewDataBinding dataBinding, ShopMyPriceListEntity entity) {
        //待报价，已报价，已失效
        if("1".equals(entity.status)) {
            baseHolder.setImageResource(R.id.price_status, R.mipmap.goods_ic_to_be_quoted);
        } else if("2".equals(entity.status)) {
            baseHolder.setImageResource(R.id.price_status, R.mipmap.goods_ic_quoted);
        } else if("4".equals(entity.status)) {
            baseHolder.setImageResource(R.id.price_status, R.mipmap.goods_ic_expired);
        }
    }
}
